08. Mocks

Mocks

Mocks

Sometimes it is impossible or undesirable to directly work with a particular object, such as if that object is unavailable or impractical to work with. But we may still want to test our code to see how it works with that object. In such cases, we can create a mock object (or mock) that simulates the real object in specific, controlled ways—and then test our code using this simulated object. In this section, we'll explore how to create such mocks using a framework called Mockito.

ND035 C04 L02 A11 Mockito

Mocking Quiz

True or False: A mock object is a real object

SOLUTION: False